
from pom.user.mainpage import MainPage
from pom.user.trogglepage import TrogglePage
from pom.user.loginpage import LoginPage
from testcases.basecase import BaseTestCase

class TestUser(BaseTestCase):

    def test_login(self):
        mp = MainPage()
        mp.open_troggle_page()

        import time
        time.sleep(1.5)

        tp = TrogglePage()
        tp.click_avatar()


        lp = LoginPage()
        lp.login_by_token('eb13d528-667a-4111-9905-5df1c08f1b17')

        # 获取登录成功 Toast 信息
        toast_text = lp.get_toast_text()
        self.assertEqual(toast_text,'登录成功')

if __name__ == '__main__':
    unittest.main(verbosity=2)


